<!--文本域，没有清空按钮-->
<template>
  <el-input
    type="textarea"
    v-model="value"
    v-bind="$attrs"
    :id="'c' + meta.columnId"
    :name="'c' + meta.columnId"
    :clearable="clearable"
    @blur="run"
    @change="run"
    @clear="run"
    @keydown="clear"
  >
  </el-input>
</template>

<script setup lang="ts" generic="T extends object">
  import type { IFormItemProps } from '../../map'
  import { itemController } from '../../map'

  defineOptions({
    name: 'nf-el-from-item-area',
    inheritAttrs: false,
  })

  // 定义 props
  const props = withDefaults(defineProps<IFormItemProps<T>>(), {
    meta: () => {
      return {
        colName: ''
      }
    },
    model: () => {
      return {} as T
    },
    clearable: true 
  })
  
  // 支持防抖等功能
  const {
    value,
    run,
    clear
  } = itemController(props)

</script>
